﻿
@{
    ViewBag.Title = "EmployeePageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css{
    <link rel="stylesheet" href="~/assets/portal/assets/css/common.css" />
    <link rel="stylesheet" href="~/bussiness/js/base/reset.css" />
    <link rel="stylesheet" href="~/bussiness/js/pg/Performance/edit.css" />
    <style>

        #editor—wrapper {
            /*max-width: 90%;*/
            width: 1200px !important;
            border: 1px solid #ccc;
            z-index: 100; /*  按需定义 */
        }

        .title {
            font-weight: bolder;
        }

        #toolbar-container {
            border-bottom: 1px solid #ccc;
        }

        #editor-container {
            min-height: 310px;
            margin-bottom: 200px;
        }

            #editor-container .title::before {
                content: ""
            }

        .ant-select-arrow, .ant-select-clear {
            position: absolute;
            right: 10px;
        }

        .stitle {
            font-size: 16px;
            font-weight: 600;
            color: #424758;
            display: flex;
            align-items: center;
        }

            .stitle::before {
                content: "";
                margin-right: 10px;
                display: inline-block;
                width: 4px;
                height: 18px;
                background: #0064E5;
            }

        .stable {
            border-collapse: collapse; /* 折叠边框，使之变为单一线划分 */
            border: 1px solid #e1e5ea; /* 设置表格、表头、单元格边框 */
            width: 100%;
            max-height: 800px;
            overflow-y: scroll;
        }

            .stable th {
                background: #f2f6f9;
                font-size: 14px;
                font-weight: 600;
            }

            .stable th, .stable td {
                border: 1px solid #e1e5ea; /* 设置表格、表头、单元格边框 */
                text-align: center;
                height: 48px;
            }
    </style>
}
<div id="EmergencyDrillADD" class="font-['SourceHanSansSC']">
    <a-style-provider hash-priority="high">
        <a-config-provider :locale="vlocale">

            <m-image-model></m-image-model>
            <m-pdf-pop-model></m-pdf-pop-model>
            <header class="px-5 box-border">
                <div class="flex items-center">
                    <div class="w-full h-[48px] text-[13px]  rounded-lg mx-auto my-[10px]  bg-white  text-[#888888] text-3xl flex items-center px-10">   <div class="w-22 h-22 bg-blue-200 mr-5"> <img class="w-full h-full cursor-pointer" v-on:click="EmergencyDrillADDParams.vvback()" src="~/Assets/nimgs/exit.png" alt="返回" /></div> <span class="text-[]">应急管理<span class="mx-2">/</span><span class="text-[#424758] text-[15px]">应急演练</span> </span>  </div>
                </div>
                <a-card :bordered="true" class="w-full  mt-12">
                    <template #title>
                        <div class="w-full flex justify-between items-center;">
                            <div class="flex items-center"> <div>应急演练</div> <div class="ml-7"></div></div>
                        </div>
                    </template>
                    <a-spin :spinning="EmergencyDrillADDParams.uploadLock.value" tip="加载中，请耐心等待..." />
                    <div class="stitle" style="margin:20px 0">基本信息</div>
                    <a-form style="margin-top:10px"
                            ref="FormRule"
                            layout="inline"
                            labelAlign="right"
                            :rules="EmergencyDrillADDParams.rules.value"
                            :model="EmergencyDrillADDParams.formData.value">
                        <a-form-item label="标题：" name="Title">
                            <a-input placeholder="请输入应急演练标题" :disabled="EmergencyDrillADDParams.urlinfo.value.type==9||[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)" v-model:value="EmergencyDrillADDParams.formData.value.Title" style="width: 200px" />
                        </a-form-item>
                        <a-form-item label="发布人：">
                            <a-input disabled v-model:value="EmergencyDrillADDParams.formData.value.user" style="width:200px" />
                        </a-form-item>
                        <a-form-item label="发布日期：">
                            <a-input disabled v-model:value="EmergencyDrillADDParams.formData.value.time" style="width: 200px" />
                        </a-form-item>


                    </a-form>
                    <div style="display:flex;margin-top:10px">
                        <a-form-item :label="`通知部门 (${EmergencyDrillADDParams.formData.value.DepList?.length}/${EmergencyDrillADDParams.deptList.value?.length})`">
                            <a-select allow-clear
                                      show-search
                                      mode="multiple"
                                      :disabled="EmergencyDrillADDParams.urlinfo.value.type==9||[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)"
                                      style="width:800px"
                                      :filter-option="EmergencyDrillADDParams.filterOption"
                                      placeholder="请选择部门"
                                      v-model:value="EmergencyDrillADDParams.formData.value.DepList"
                                      :options="EmergencyDrillADDParams.deptList.value"></a-select>
                        </a-form-item>
                        <a-form-item style="margin-left:10px">
                            <a-button v-if="EmergencyDrillADDParams.urlinfo.value.type!=9&&![1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)" v-on:click="EmergencyDrillADDParams.handleallChoose" type="primary">{{EmergencyDrillADDParams.allChoose.value==false?'全选':'取消'}}</a-button>
                        </a-form-item>
                    </div>

                    <div class="stitle" style="margin:20px 0">演练计划</div>
                    <a-card :bordered="true" class="w-full  mt-12">
                        <template #title>
                            <div class="w-full flex justify-between items-center;">
                                <div class="flex items-center"> <div v-if="EmergencyDrillADDParams.formData.value.DepList.length!=0">任务覆盖度: {{Array.from(new Set(EmergencyDrillADDParams.settingList?.value.filter(e=>Boolean(e.DepartmentId)).map(e=>e.DepartmentId))).length}}/{{EmergencyDrillADDParams?.formData.value.DepList.length}}</div> <div class="ml-7"></div></div>
                                <div v-if="[2].includes(+EmergencyDrillADDParams.urlinfo?.value.target)">
                                    <a-space>

                                        <a-button :disabled="EmergencyDrillADDParams.settingList?.value.filter(e=>e.ck==true).length==0" v-if="EmergencyDrillADDParams.userinfo?.value?.DepartmentId==20" v-on:click="EmergencyDrillADDParams.handleAllPass" type="primary">一键复查</a-button>

                                    </a-space>
                                </div>
                                <div v-else>

                                    <a-space v-if="!EmergencyDrillADDParams.urlinfo.value.type||+EmergencyDrillADDParams.urlinfo.value.type!=9">
                                        <a-button v-on:click="EmergencyDrillADDParams.handleDownloadTemplate" style="background: #17d46b;color:white">下载模版</a-button>
                                        <a-upload action="#"
                                                  :show-upload-list="false"
                                                  v-on:change="EmergencyDrillADDParams.handleImport">
                                            <a-button v-if="EmergencyDrillADDParams.urlinfo.value.type!=9" type="primary">导入</a-button>
                                        </a-upload>

                                    </a-space>
                                </div>
                            </div>
                        </template>
                        <div v-if="EmergencyDrillADDParams.urlinfo.value.type==9" style="margin:10px 0">
                            <a-space>


                                部门;  <a-select allow-clear
                                               show-search
                                               style="width:150px"
                                               :filter-option="EmergencyDrillADDParams.filterOption"
                                               placeholder="请先选择部门"
                                           
                                               v-model:value="EmergencyDrillADDParams.tableQueryParams.value.DepartmentId"
                                               :options="EmergencyDrillADDParams.deptList.value.filter(e=>EmergencyDrillADDParams.formData.value.DepList.includes(e.value))"></a-select>

                                时间: <a-range-picker  v-model:value="EmergencyDrillADDParams.tableQueryParams.value.Time" />


                            </a-space>
                            <a-space style="margin-left:40px">
                                <a-button v-on:click="EmergencyDrillADDParams.handleSearchTableData" type="primary">搜索</a-button>
                                <a-button v-on:click="EmergencyDrillADDParams.handleResetTableData">重置</a-button>
                            </a-space>
                 
                        </div>
                        <table class="stable">
                            <tr>
                                <th v-if="[2].includes(+EmergencyDrillADDParams.urlinfo.value.target)"><a-checkbox v-on:change="EmergencyDrillADDParams.boxChange" v-model:checked="EmergencyDrillADDParams.checked.value">{{EmergencyDrillADDParams.checked.value==true?'取消':'全选'}}</a-checkbox></th>
                                <th>序号</th>
                                <th>部门</th>
                                <th>计划时间</th>
                                <th>演练名称</th>
                                <th>演练形式</th>
                                <th>参演范围</th>
                                <th v-if="[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)">完成情况</th>
                                <th v-if="[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)">操作</th>
                                <th v-if="EmergencyDrillADDParams.urlinfo.value.type!=9&&![1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)"><a-button v-on:click="EmergencyDrillADDParams.addConfig" type="primary">新增</a-button></th>
                            </tr>
                            <tr v-for="(e,i) in EmergencyDrillADDParams.isImport.value? EmergencyDrillADDParams.settingList.value.slice((EmergencyDrillADDParams.pagination.value.current-1)*EmergencyDrillADDParams.pagination.value.pageSize, EmergencyDrillADDParams.pagination.value.current*EmergencyDrillADDParams.pagination.value.pageSize):EmergencyDrillADDParams.settingList.value" :key="e.Id+e.DrillName">
                                <td v-if="[2].includes(+EmergencyDrillADDParams.urlinfo.value.target)">
                                    <a-checkbox v-onchange="EmergencyDrillADDParams.iboxChange(e.ck)" :disabled="e.Status!=1" v-model:checked="e.ck"></a-checkbox>
                                </td>
                                <td>
                                    {{( EmergencyDrillADDParams.pagination.value.current-1)*EmergencyDrillADDParams.pagination.value.pageSize+ i+1}}
                                </td>
                                <td>
                                    <a-select allow-clear
                                              show-search
                                              :disabled="EmergencyDrillADDParams.formData.value.DepList.length==0||EmergencyDrillADDParams.urlinfo.value.type==9||[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)"
                                              style="width:150px"
                                              :filter-option="EmergencyDrillADDParams.filterOption"
                                              placeholder="请先选择通知部门"
                                              v-model:value="e.DepartmentId"
                                              :options="EmergencyDrillADDParams.deptList.value.filter(e=>EmergencyDrillADDParams.formData.value.DepList.includes(e.value))"></a-select>
                                </td>
                                <td>
                                    <a-date-picker :disabled="EmergencyDrillADDParams.urlinfo.value.type==9||[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)" v-model:value="e.PlanDate" />

                                </td>
                                <td>
                                    <a-input style="max-width: 200px " :disabled="EmergencyDrillADDParams.urlinfo.value.type==9||[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)" v-model:value="e.DrillName">
                                    </a-input>
                                </td>
                                <td>
                                    <a-input style="max-width: 200px " :disabled="EmergencyDrillADDParams.urlinfo.value.type==9||[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)" v-model:value="e.DrillType">
                                    </a-input>
                                </td>
                                <td>
                                    <a-input style="max-width: 200px " :disabled="EmergencyDrillADDParams.urlinfo.value.type==9||[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)" v-model:value="e.Range">
                                    </a-input>
                                </td>
                                <td v-if="[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)">
                                    <a-tag :color="e.StatusName=='驳回'?'red':'#0c89da'">{{e.StatusName}}</a-tag>
                                </td>
                                <td v-if="[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)">
                                    <div v-if="[0,3].includes(e.Status)">
                                        <a-space>
                                            <a-button v-on:click="EmergencyDrillADDParams.handleUpload(e)" v-if="e.IsShowUpload&&!EmergencyDrillADDParams.urlinfo.value.d" type='link'>上传</a-button>
                                            <a-button v-on:click="EmergencyDrillADDParams.handleReview(e,true,e.Status==3?true:false)" type='link'>详情</a-button>
                                        </a-space>
                                    </div>
                                    <div v-else-if="e.Status==1">
                                        <a-space>
                                            <a-button v-on:click="EmergencyDrillADDParams.handleReview(e,true)" v-if="e.IsShowReview&&!EmergencyDrillADDParams.urlinfo.value.d" type='link'>复查</a-button>
                                            <a-button v-on:click="EmergencyDrillADDParams.WithdrawEmergencyDrillReport(e,true)" v-if="e.IsShowCallback&&!EmergencyDrillADDParams.urlinfo.value.d" type='link'>撤回上传</a-button>
                                            <a-button v-on:click="EmergencyDrillADDParams.handleReview(e,true,true)" type='link'>详情</a-button>
                                        </a-space>
                                    </div>
                                    <div v-else>
                                        <a-button v-on:click="EmergencyDrillADDParams.handleReview(e,true,true)" type='link'>详情</a-button>
                                    </div>
                                </td>
                                <td v-if="EmergencyDrillADDParams.urlinfo.value.type!=9&&![1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)">
                                    <a-button v-on:click="EmergencyDrillADDParams.delConfig(i,e)" type="primary" danger>删除</a-button>
                                </td>
                            </tr>
                        </table>
                        <div style="width:100%;display:flex;justify-content:flex-end;">
                            <a-pagination style="margin:10px auto"
                                          v-model:current="EmergencyDrillADDParams.pagination.value.current"
                                          v-model:page-size="EmergencyDrillADDParams.pagination.value.pageSize"
                                          show-size-changer
                                          :total="EmergencyDrillADDParams.pagination.value.total"
                                          v-on:change="EmergencyDrillADDParams.onPageChange" />
                        </div>
                    </a-card>

                    <a-form-item label-align="right" style="margin-top:20px" label="备注：">
                        <a-textarea style="width:600px" :disabled="EmergencyDrillADDParams.urlinfo.value.type==9||[1,2].includes(+EmergencyDrillADDParams.urlinfo.value.target)" v-model:value="EmergencyDrillADDParams.formData.value.Remark">
                        </a-textarea>
                    </a-form-item>
                </a-card>
                <a-modal :footer="null" v-model:open="EmergencyDrillADDParams.popShow.value" width="50%" style="min-width:600px" :title="EmergencyDrillADDParams.uItem.value?.Status==0? EmergencyDrillADDParams.isDetail.value?'上传详情':'上传':EmergencyDrillADDParams.isRDetail.value?'复查详情':'复查'" v-on:cancel="EmergencyDrillADDParams.popShow.value=false">
                    <a-spin :spinning="EmergencyDrillADDParams.uploadLock.value" tip="加载中，请耐心等待..." />
                    <div style="max-height:600px;overflow-y:scroll">
                        <div class="stitle" style="margin:20px 0">基本信息</div>
                        <a-form v-if="EmergencyDrillADDParams.uItem.value" style="margin-top:10px"
                                layout="inline">
                            <a-form-item label="演练名称：">
                                <a-input disabled v-model:value="EmergencyDrillADDParams.uItem.value.DrillName" style="width:200px" />
                            </a-form-item>
                            <a-form-item label="计划时间：">
                                <a-input disabled v-model:value="EmergencyDrillADDParams.uItem.value.PlanDate" style="width: 200px" />
                            </a-form-item>
                        </a-form>
                        <template v-if="EmergencyDrillADDParams.isDetail.value">
                            <div class="stitle" style="margin:20px 0">
                                上传记录
                            </div>
                            <table v-if="EmergencyDrillADDParams.upLoadRecord.value.length!=0" class="stable">
                                <tr>

                                    <th>序号</th>
                                    <th>类型</th>
                                    <th>上传时间</th>
                                    <th>上传人</th>
                                    <th>文件名称</th>
                                    <th>操作</th>


                                <tr v-for="(e,i) in EmergencyDrillADDParams.upLoadRecord.value" :key="i">

                                    <td>
                                        {{i+1}}
                                    </td>

                                    <td>
                                        {{e.TypeName}}
                                    </td>
                                    <td>
                                        {{e.UpdateTime}}
                                    </td>
                                    <td>
                                        {{e.UploadUser}}
                                    </td>
                                    <td>
                                        {{e.FileName}}
                                    </td>
                                    <td>
                                        <a-button v-on:click="EmergencyDrillADDParams.downLoad(e.FileName,e.FilePath)" type="link">下载</a-button>
                                        <a-button v-if="['jpg','jpeg','png','gif','bmp','tiff','svg','pdf'].includes(e.FileExtension)" v-on:click="EmergencyDrillADDParams.handlePreview(e)" type="link">预览</a-button>
                                        <a-button v-if="[1].includes(+EmergencyDrillADDParams.urlinfo.value.target)" v-on:click="EmergencyDrillADDParams.IshowDeleteConfirm(e.Id)" type="link" danger>删除</a-button>
                                    </td>
                                </tr>
                            </table>
                            <template v-else>

                                <div class="w-full flex justify-center font-[600]">
                                    暂无数据
                                </div>

                            </template>
                            <template v-if="EmergencyDrillADDParams.uItem.value?.Status==0&&EmergencyDrillADDParams.isDetail.value">
                                <div class="stitle" style="margin:20px 0">复查记录</div>
                                <table v-if="EmergencyDrillADDParams.reviewRecord.value.length!=0" class="stable">
                                    <tr>

                                        <th>序号</th>

                                        <th>复查时间</th>
                                        <th>复查人</th>
                                        <th>复查结果</th>
                                        <th>备注</th>


                                    <tr v-for="(e,i) in EmergencyDrillADDParams.reviewRecord.value" :key="i">

                                        <td>
                                            {{i+1}}
                                        </td>

                                        <td>
                                            {{e.CreateTime}}
                                        </td>
                                        <td>
                                            {{e.User}}
                                        </td>
                                        <td>
                                            <a-tag :color="e.Result?'green':'red'" type="primary">{{e.ResultName}}</a-tag>

                                        </td>
                                        <td>
                                            {{e.Remark}}
                                        </td>


                                    </tr>


                                </table>
                                <template v-else>

                                    <div class="w-full flex justify-center font-[600]">
                                        暂无数据
                   
                                    </div>

                                </template>
                            </template>
                        </template>
                        <template v-else>
                            <div class="stitle" style="margin:20px 0">演练方案<div style="margin-left:20px"></div></div>
                            <a-form-item label="附件：">
                                <a-upload v-model:file-list="EmergencyDrillADDParams.uploadImg1.value.fileList"
                                          action="#"
                                           multiple
                                          :item-render="($event)=> EmergencyDrillADDParams.itemRender($event,'1')"
                                          v-on:change="EmergencyDrillADDParams.handleChange($event,'1')">
                                    <a-button v-if="EmergencyDrillADDParams.uploadImg1.value.fileList.length < 8 && EmergencyDrillADDParams.urlinfo.value.type!=9" type="primary">+ 上传附件</a-button>

                                </a-upload>
                            </a-form-item>
                            <div class="stitle" style="margin:20px 0">记录评估表<div style="margin-left:20px"></div></div>

                            <a-form-item label="附件：">
                                <a-upload v-model:file-list="EmergencyDrillADDParams.uploadImg2.value.fileList"
                                          action="#"
                                          multiple
                                          :item-render="($event)=> EmergencyDrillADDParams.itemRender($event,'2')"
                                          v-on:change="EmergencyDrillADDParams.handleChange($event,'2')">
                                    <a-button v-if="EmergencyDrillADDParams.uploadImg2.value.fileList.length < 8 && EmergencyDrillADDParams.urlinfo.value.type!=9" type="primary">+ 上传附件</a-button>

                                </a-upload>
                            </a-form-item>
                            <div class="stitle" style="margin:20px 0">照片 <div style="margin-left:20px"></div></div>

                            <a-form-item label="附件：">
                                <a-upload v-model:file-list="EmergencyDrillADDParams.uploadImg3.value.fileList"
                                          action="#"
                                          multiple
                                          :item-render="($event)=> EmergencyDrillADDParams.itemRender($event,'3')"
                                          v-on:change="EmergencyDrillADDParams.handleChange($event,'3')">
                                    <a-button v-if="EmergencyDrillADDParams.uploadImg3.value.fileList.length < 8 && EmergencyDrillADDParams.urlinfo.value.type!=9" type="primary">+ 上传附件</a-button>

                                </a-upload>
                            </a-form-item>
                        </template>
                        <template v-if="EmergencyDrillADDParams.uItem.value?.Status>=1&&EmergencyDrillADDParams.isRDetail.value">
                            <div class="stitle" style="margin:20px 0">复查记录</div>
                            <table v-if="EmergencyDrillADDParams.reviewRecord.value.length!=0" class="stable">
                                <tr>

                                    <th>序号</th>

                                    <th>复查时间</th>
                                    <th>复查人</th>
                                    <th>复查结果</th>
                                    <th>备注</th>


                                <tr v-for="(e,i) in EmergencyDrillADDParams.reviewRecord.value" :key="i">

                                    <td>
                                        {{i+1}}
                                    </td>

                                    <td>
                                        {{e.CreateTime}}
                                    </td>
                                    <td>
                                        {{e.User}}
                                    </td>
                                    <td>
                                        <a-tag :color="e.Result?'green':'red'" type="primary">{{e.ResultName}}</a-tag>

                                    </td>
                                    <td>
                                        {{e.Remark}}
                                    </td>


                                </tr>


                            </table>
                            <template v-else>

                                <div class="w-full flex justify-center font-[600]">
                                    暂无数据
                                </div>

                            </template>
                        </template>




                        <a-form-item label-align="right" v-if="EmergencyDrillADDParams.uItem.value?.Status==1&&!EmergencyDrillADDParams.isRDetail.value" style="margin-top:20px" label="备注：">
                            <a-textarea style="width:600px" :disabled="EmergencyDrillADDParams.urlinfo.value.type==9" v-model:value="EmergencyDrillADDParams.rformData.value.Remark">
                            </a-textarea>
                        </a-form-item>

                        <div style="width:100%;display:flex;justify-content:flex-end;margin-top:20px">
                            <a-space v-if="[0,3].includes(EmergencyDrillADDParams.uItem.value.Status)">
                                <template v-if="EmergencyDrillADDParams.isDetail.value">
                                    <a-button v-on:click="EmergencyDrillADDParams.handleCancel" type="dashed">取消</a-button>
                                </template>
                                <template v-else>
                                    <a-button v-on:click="EmergencyDrillADDParams.handleCancel" type="dashed">取消</a-button>
                                    <a-button v-on:click="EmergencyDrillADDParams.IhandlePopOp(0)">保存</a-button>
                                    <a-button v-on:click="EmergencyDrillADDParams.IhandlePopOp(1)" type="primary">提交</a-button>
                                </template>


                            </a-space>
                            <a-space v-if="![0,3].includes(EmergencyDrillADDParams.uItem.value.Status)">
                                <template v-if="EmergencyDrillADDParams.isRDetail.value">
                                    <a-button v-on:click="EmergencyDrillADDParams.handleCancel" type="dashed">取消</a-button>
                                </template>
                                <template v-else>
                                    <a-button v-on:click="EmergencyDrillADDParams.handleCancel" type="primary" danger>驳回</a-button>
                                    <a-button v-on:click="EmergencyDrillADDParams.IhandlePopOp" type="primary">通过</a-button>
                                </template>


                            </a-space>
                        </div>
                    </div>
                </a-modal>
            </header>
            <m-bottom-btns></m-bottom-btns>
        </a-config-provider>
    </a-style-provider>
</div>
@section Js{
    <script src="~/bussiness/js/base/tailwind.js"></script>
    <script>
    </script>
    <script type="module">
        import Composition from '../../bussiness/js/pg/EmergencyManagement/EDAdd.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")'
        import localeValues from '../../Bussiness/js/base/es/locale/zh_CN.js'
        singalApp('EmergencyDrillADD', Composition, localeValues)
    </script>
}
